package com.SpringBoot.order.mapper;

import com.SpringBoot.order.dto.OrderDto;
import com.SpringBoot.order.pojo.Order;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface OrderMapper {

    int addOrder(Order order);

    Order selectExistOrder(@Param("userId") Integer userId);

    List<OrderDto> selectUserOrder(@Param("userId") Integer userId);

    int deleteOrder(@Param("orderId") Integer orderId);

    void updateByOrderId(@Param("orderId") Integer orderId,
                         @Param("status") Integer status);

    BigDecimal allAmout();

    List<OrderDto> selectOrderByOrderId(@Param("orderId") Integer orderId);

    List<OrderDto> selectOrderByPage(@Param("pageNum") Integer pageNum,
                                     @Param("pageSiza") Integer pageSize);
}
